textview: Use content size when validating contents
authorTimm Bäder <mail@baedert.org>
Sat, 24 Feb 2018 09:49:30 +0000 (10:49 +0100)
committerTimm Bäder <mail@baedert.org>
Sun, 25 Feb 2018 15:47:20 +0000 (16:47 +0100)
gtk/gtktextview.c

index 8abb165e97c272e89215d43b0e81da2c2490e2cf..85daa761d0e2d116289b252327ac4eb090cc6564 100644 (file)
@@ -2482,7 +2482,7 @@ gtk_text_view_queue_scroll (GtkTextView   *text_view,
 static gboolean
 gtk_text_view_flush_scroll (GtkTextView *text_view)
 {
-  GtkAllocation allocation;
+  int height;
   GtkTextIter iter;
   GtkTextPendingScroll *scroll;
   gboolean retval;
@@ -2513,10 +2513,10 @@ gtk_text_view_flush_scroll (GtkTextView *text_view)
    * the screen.
    */
   DV(g_print (">Validating scroll destination ("G_STRLOC")\n"));
-  gtk_widget_get_allocation (widget, &allocation);
+  height = gtk_widget_get_height (widget);
   gtk_text_layout_validate_yrange (text_view->priv->layout, &iter,
-                                   -(allocation.height * 2),
-                                   allocation.height * 2);
+                                   - (height * 2),
+                                   height * 2);
 
   DV(g_print (">Done validating scroll destination ("G_STRLOC")\n"));